package com.mob.sdk.verify.dubboTest;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON;
import com.mob.sdk.verify.component.interfaces.AccountService;
import com.mob.sdk.verify.component.interfaces.TestService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * DTestService
 * Date: 2019/8/8
 * Time: 15:13
 *
 * @author tangwch
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
public class DTestService {

    @Reference
    private TestService testService;

    @Reference(check = false, lazy = true, timeout = 2000)
    private AccountService accountService;

    @Test
    public void test() {
        System.out.println(testService.print());
    }

    @Test
    public void findAccount() {
        System.out.println(JSON.toJSONString(accountService.findByDevId("devId")));
    }
}
